<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        *{
            margin:0px;
            padding: 0px;
        }
        ul{
            list-style: none;
        }
        .tabBox{
            width:1000px;
            margin:50px auto;
            border:1px solid #ddd;
        }
        .tabBox ul{
            overflow: hidden;
        }
        .tabBox ul>li{
            float:left;
            border-right:1px solid #ddd;
            border-bottom:1px solid #ddd;
            padding:20px 50px;
        }
        .tabBox li.active{
            background-color: red;
        }
        .box>div{
            line-height: 100px;
            display: none;
        }
    </style>
    <script src="../js/jquery.min.js"></script>
    <script>
        $(function(){
            $('.box > div:first').show();
            $('ul>li:first').addClass('active');
            $('ul > li').click(function(){
                var index=$(this).index();
                console.log(index);
                $('.box>div').hide().eq(index).show();
                $("ul>li").removeClass("active").eq(index).addClass("active");
            });
        });
    </script>
</head>
<body>
    <div class="tabBox">
        <ul>
            <li>商品介绍</li>
            <li>规格与包装</li>
            <li>售后保障</li>
            <li>商品评价（412654）</li>
            <li>手机社区</li>
        </ul>
        <div class="box">
            <div>商品介绍1231231242352352</div>
            <div>规格与包1231231242352352</div>
            <div>售后保障1231231242352352</div>
            <div>商品评价1231231242352352</div>
            <div>手机社区1231231242352352</div>
        </div>
    </div>
</body>
</html>